package com.lex.cheeseStrip.app;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;

import com.dh.cheesestrip.HttpUtil.HttpSender;
import com.dh.cheesestrip.Util.ActUtil;

import butterknife.ButterKnife;
import cn.jpush.android.api.JPushInterface;

/**
 * Created by M.c on 2016/1/11.
 */
public class BaseAct extends AppCompatActivity {


    protected void init(Activity context) {
        ActUtil.getInstance().addActivity(context);
        ButterKnife.bind(context);
    }

    protected Activity getActivity() {
        return this;
    }

    @Override
    protected void onResume() {
        super.onResume();
        JPushInterface.onResume(getActivity());
    }

    @Override
    protected void onPause() {
        super.onPause();
        JPushInterface.onPause(getActivity());
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ActUtil.getInstance().clearAct(getActivity());
        HttpSender.getInstance().cancelTag(getActivity());
    }
}
